local iori_attack2 = class('iori_attack2',function()
	return display.newNode()
end)

function iori_attack2:ctor()
	self:pos(display.cx,0)
	display.newSolidCircle(8,{color = cc.c4f(1.0,0,1.0,0.8)}):addTo(self)
	frames = display.newFrames("iori_ack2_%03d.png", 0, 20)

	local node = display.newNode():addTo(self)
	node:setRotation(90)
	node:retain()
	printf('node aPx=%g,aPy=%g,orPx=%g,orPy=%g',
		node:getAnchorPoint().x,
		node:getAnchorPoint().y,
		node:getPositionX(),
		node:getPositionY()
	)
	--self.iori = cc.Sprite:createWithSpriteFrame(frames[1]):addTo(node)
	self.iori = cc.Sprite:create():addTo(node)
	self.iori:setTag(21)
	self.iori:setAnchorPoint(cc.p(1,0))
	local w = self.iori:getContentSize().width + 20
	sequence = cc.Sequence:create(
		cc.Animate:create(display.newAnimation(frames, 1.6/#frames)),
		cc.CallFunc:create(function()
			--local x = node:getPositionX() - 60
			--node:setPositionX(x)
			node:removeChildByTag(21)
			local iori_back = cc.Sprite:createWithSpriteFrame(frames2[1])
			--iori_back:setRotation(90)
			--iori_back:pos(45,45)
			iori_back:setTag(22)
			iori_back:setPositionX(-146)
			iori_back:setPositionY(30)
			iori_back:setAnchorPoint(cc.p(1,0))
			if not iori_back then print(' not have iori_back ') end
			if not node then print(' not have node ') end
			node:addChild(iori_back)
			if not sequence2 then print(' not have sequence2 ') end
			iori_back:runAction(sequence2)
			end)
		)
	sequence:retain()
	--self.iori:runAction(cc.RepeatForever:create(sequence))
	self.iori:runAction(sequence)
	self.iori:retain()

	frames2 = display.newFrames("iori2_%03d.png", 26, 14)
	--self.iori_back = cc.Sprite:createWithSpriteFrame(frames2[1]):addTo(self)
	--self.iori_back2 = cc.Sprite:createWithSpriteFrame(frames2[1]):addTo(self)
	--self.iori_back2:setRotation(90)
	--self.iori_back:retain()

	sequence2 = cc.Sequence:create(
		cc.Animate:create(display.newAnimation(frames2, 1.2/#frames2)),
		cc.CallFunc:create(function()
			--local x = node:getPositionX() + 60
			--node:setPositionX(x)
			node:removeChildByTag(22)
			iori = cc.Sprite:createWithSpriteFrame(frames[1])
			--iori:setRotation(90)
			--iori:setPosition(40,0)
			iori:setTag(21)
			iori:setAnchorPoint(cc.p(1,0))
			node:addChild(iori)
			iori:runAction(sequence)
			end)
		)
	sequence2:retain()
end

return iori_attack2 